//
//  WKCMSenderView.m
//  WKMaybell
//
//  Created by 何文虎 on 2019/4/11.
//  Copyright © 2019 何文虎. All rights reserved.
//

#import "WKCMSenderView.h"

@interface WKCMSenderView ()
@property(nonatomic,strong)UIButton *zanBtn;
@property(nonatomic,strong)UIButton *liwuBtn;
@property(nonatomic,strong)UIButton *commentBtn;
@end

@implementation WKCMSenderView

- (instancetype)initWithFrame:(CGRect)frame{
    if (self == [super initWithFrame:frame]) {
        [self setup];
    }
    return self;
}

- (void)setup{
    
    CGFloat btn_width = ScreenWidth/3;
    
    [self addSubview:self.zanBtn];
    [self.zanBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.width.mas_equalTo(0);
        make.size.mas_equalTo(CGSizeMake(btn_width, 44));
    }];
    
    [self addSubview:self.liwuBtn];
    [self.liwuBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.width.mas_equalTo(0);
        make.left.mas_equalTo(self.zanBtn.mas_right);
        make.size.mas_equalTo(CGSizeMake(btn_width, 44));
    }];
    
    [self addSubview:self.commentBtn];
    [self.commentBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.width.mas_equalTo(0);
        make.left.mas_equalTo(self.liwuBtn.mas_right);
        make.size.mas_equalTo(CGSizeMake(btn_width, 44));
    }];
    
    [_zanBtn setTitle:@"130" forState:UIControlStateNormal];
    [_liwuBtn setTitle:@"285" forState:UIControlStateNormal];
    [_commentBtn setTitle:@"123" forState:UIControlStateNormal];
    
}

- (UIButton*)zanBtn{
    if (!_zanBtn) {
        _zanBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        _zanBtn.titleLabel.font = PFSC_MediumFont(11);
        [_zanBtn setTitleColor:UIColorFromHex(0x11) forState:UIControlStateNormal];
        [_zanBtn setImage:ImageNamed(@"zan_normal.png") forState:UIControlStateNormal];
        [_zanBtn setImage:ImageNamed(@"zan_selected.png") forState:UIControlStateHighlighted];
        [_zanBtn setImage:ImageNamed(@"zan_selected.png") forState:UIControlStateSelected];
    }
    return _zanBtn;
}

- (UIButton*)liwuBtn{
    if (!_liwuBtn) {
        _liwuBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        _liwuBtn.titleLabel.font = PFSC_MediumFont(11);
        [_liwuBtn setTitleColor:UIColorFromHex(0x11) forState:UIControlStateNormal];
        [_liwuBtn setImage:ImageNamed(@"cm_liwu.png") forState:UIControlStateNormal];
    }
    return _liwuBtn;
}

- (UIButton*)commentBtn{
    if (!_commentBtn) {
        _commentBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        _commentBtn.titleLabel.font = PFSC_MediumFont(11);
        [_commentBtn setTitleColor:UIColorFromHex(0x11) forState:UIControlStateNormal];
        [_commentBtn setImage:ImageNamed(@"comment_normal.png") forState:UIControlStateNormal];
    }
    return _commentBtn;
}

@end
